<!--------------------------------------------------------------
>//	Company:	HTHK
>//	NAME:	    ProjectCategory.jsp
>//	TITLE:	    The maintence of projectCategory
>//	FUNCTION:	The save and update and delete page of projectCategory
>//	BY:	        Kodak Xu
>//	DATE:	    09/12/2003
//	Update_by	Poly Li
//	Update_date	16-01-2004
>// --------------------------------------------------------------
>// MODIFICATION HISTORY
>// --------------------------------------------------------------
>//	CR Log #:  99999  BY:  XXXX   DATE:  dd/mm/yyyy
>//	ERROR:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>//	FIX:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>// --------------------------------------------------------------
-->

<%@ include file="../tssheader.jsp"   %>
<%@ page import="tss.projectcategory.*" %>
<%@ page import="com.ffpc.html.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="tss.options.*"%>
<%@ page import="java.util.Calendar"%>

<%    
	Calendar now = Calendar.getInstance();
	//String year_now = String.valueOf(now.get(now.YEAR));
	//String month_now = (now.get(now.MONTH)+1)>10?String.valueOf((now.get(now.MONTH)+1)):"0"+String.valueOf((now.get(now.MONTH)+1));

	//YearOptions year = new YearOptions();
	//MonthOptions month = new MonthOptions();
	CompanyOptions co = new CompanyOptions();

	String selectedStr1 = "";
    String selectedStr2 = "";

    String readOnlyStr = "";
	String buleStr = "";
    
    formAction = request.getParameter("formAction");
    if (!formAction.equals("Create")) 
	{
        readOnlyStr = "readonly";
		buleStr = "class=read";
    }
    
    ProjectCategoryBean projectCategory1 = (ProjectCategoryBean)request.getAttribute("projectCategory");
    if (projectCategory1==null) 
	   projectCategory1 = new ProjectCategory();
	/*
	String from = projectCategory1.getEffective_range_from();
	String year_from = "";
	String month_from = "";
	if (from!=null && from.length()!=0)
	{
		year_from =
 from.substring(0,4);
		month_from = from.substring(5,7);
	}

	String to = projectCategory1.getEffective_range_to();
	String year_to = "";
	String month_to = "";
	if (to!=null && to.length()!=0)
	{
		year_to =
 to.substring(0,4);
		month_to = to.substring(5,7);
	}*/
%>

<body>
<script language="javascript1.1">
 
    function formValidation() 
	{
        var d1 = fm.project_category_name;
        var d2 = fm.company_code;
        
		if (isNull(d1,"Project Category Name")||isNull(d2,"Company code"))
		{
            return false;
        }
		return true;
    }
</script>

<h2>Project Category Maintenance</h2>
<form id=fm method=post action='<%=contextPath%>/servlet/tss.projectcategory.ProjectCategoryServlet' >
<input type=hidden name=formAction value=<%=formAction%> >
<table cols=10 border=0 >

<tr>
  <td>Department*:</td>
  <td>&nbsp;</td>
  <td>
	<select name='company_code'>
		<%=co.getOptions(projectCategory1.getCompany_code(),false)%>
	</select>
  </td>
</tr>

<tr>
  <td>Project Category*:</td>
  <td>&nbsp;</td>
  <td><input type=text name='project_category_name' <%=buleStr%> size=20 value='<%=projectCategory1.getProject_category_name()%>' onBlur="this.value=this.value.toUpperCase();" <%=readOnlyStr%> maxlength=20 >
  </td>
</tr>



<tr>
  <td nowrap>Comments:<br>(255 characters max)</td>
  <td>&nbsp;</td>
  <td colspan=4>
	  <input type=text name='comments' size=40 value='<%=projectCategory1.getComments()%>' maxlength=255>
  </td>
</tr>

</table>
<br>
<hr>
<p>
  <INPUT type=button value=Save onclick="save()" >
  <INPUT type=button value=Delete  onclick="deleteRecord()"  >
  <INPUT type=reset  value=Cancel >
  <INPUT type=button value=Back onclick="javascript:history.back()">
</p>
</form>
<%@ include file="../tssfooter.jsp" %>
</body>
</html>
